<#
 #   It is recommended to test the script on a local machine for its purpose and effects. 
 #   ManageEngine Endpoint Central will not be responsible for any 
 #   damage/loss to the data/setup based on the behavior of the script.

 #   Description: Script is designed to Fetch Hard Disk Drive Details
 #   Configuration Type - COMPUTER
 #>

$hardDisks = Get-PhysicalDisk
$hddExists = $false

foreach ($disk in $hardDisks) {
    if ($disk.MediaType -eq 'HDD') {
        $hddExists = $true
        Write-Host "Hard Disk Type: $disk.MediaType"
    }
}

if (-not $hddExists) {
    Write-Host "No HDD exists."
}